package mains;

import cartes.Denomination;
import java.util.Comparator;

public class RangPoker implements Comparable<Object>
{
    int score = 0;
    Denomination topCarte;

    public RangPoker() {}
	
    @Override
    public int compareTo(Object o) 
    { 
        if(!(o instanceof RangPoker)) return 0;
            
        RangPoker rp2 = (RangPoker) o;
            
        //System.out.println("rp1 = " + this.score + " rp2 = " + rp2.score);
        //System.out.println("tc2 = " + this.topCarte + " tc2 = " + rp2.topCarte);
        //System.out.println("result = score = " + (rp2.score - this.score) + " topCarte = " + rp2.topCarte.compareTo(topCarte));
        
        if(rp2.score - this.score == 0)
            return this.topCarte.compareTo(rp2.topCarte);
        else
            return this.score - rp2.score;
    }
	
	public static RangPoker getRang(Main m) 
        {
            return AbstractAnalyseurRang.traiterDemande(m);            
        }	
}
